<?php

namespace App\Http\Middleware;

use Closure;

class ScreenMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(!trim($request->input('name'))){
            return ['status'=>'error','message'=>'影厅名称必填','data'=>''];
        }

        if(!trim($request->input('type'))){
            return ['status'=>'error','message'=>'影厅类型必填','data'=>''];
        }

        if(!trim($request->input('status'))){
            return ['status'=>'error','message'=>'影厅营业状态必填','data'=>''];
        }

        return $next($request);
    }
}
